﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ggprot
{
    public delegate void AddressObtainedEventHandler(object sender, AddressObtainedEventArgs e);
    public delegate void PacketEventHandler(object sender, PacketEventArgs e);
    public delegate void LoginResponseReceivedEventHandler(object sender, LoginResponseReceivedEventArgs e);
    public delegate void MessageReceivedEventHandler(object sender, MessageReceivedEventArgs e);
    public delegate void TypingNotifyEventHandler(object sender, TypingNotifyEventArgs e);
    public delegate void MultiLoginEventHandler(object sender, MultiLoginEventArgs e);

    public class PacketEventArgs : EventArgs
    {
        private GGHeader packet;

        public GGHeader Packet
        {
          get { return packet; }
          set { packet = value; }
        }

        public PacketEventArgs(GGHeader packet)
            : base()
        {
            this.packet = packet;
        }
    }

    public class AddressObtainedEventArgs : EventArgs
    {
        private bool status;
        private string response;

        public string Response
        {
            get { return response; }
            set { response = value; }
        }

        public bool Status
        {
            get { return status; }
            set { status = value; }
        }

        public AddressObtainedEventArgs(bool status, string response)
            : base()
        {
            this.status = status;
            this.response = response;
        }
    }

    public class LoginResponseReceivedEventArgs : EventArgs
    {
        private bool status;

        public bool Status
        {
            get { return status; }
            set { status = value; }
        }

        public LoginResponseReceivedEventArgs(bool status)
        {
            this.status = status;
        }
    }

    public class MessageReceivedEventArgs : EventArgs
    {
        private int uin;
        private string message;

        public string Message
        {
            get { return message; }
            set { message = value; }
        }

        public int Uin
        {
            get { return uin; }
            set { uin = value; }
        }

        public MessageReceivedEventArgs(int uin, string msg)
        {
            this.uin = uin;
            this.message = msg;
        }
    }

    public class TypingNotifyEventArgs : EventArgs
    {
        private int uin;
        private bool typing;

        public bool Typing
        {
            get { return typing; }
            set { typing = value; }
        }

        public int Uin
        {
            get { return uin; }
            set { uin = value; }
        }

        public TypingNotifyEventArgs(int uin, bool typing)
        {
            this.uin = uin;
            this.typing = typing;
        }
    }

    public class MultiLoginEventArgs : EventArgs
    {
        private GGMultiloginInfo inf;

        public GGMultiloginInfo Inf
        {
            get { return inf; }
            set { inf = value; }
        }

        public MultiLoginEventArgs(GGMultiloginInfo inf)
        {
            this.inf = inf;
        }
    }
}
